#pragma once

struct KeyPoints
    {
    POINT LeftEye;
    POINT RightEye;
    POINT Mouth;
    } ;

class CCropImage
{
public:
	CCropImage(void);
	~CCropImage(void);
	BOOL AlignFaceRegion1(BYTE* pbyteSrcImg, int nWidth, int nHeight, KeyPoints keyPoint,
		BYTE * pbyteAlignedImg, int nDstImgWidth, int nDstImgHeight);
	BOOL AlignFaceRegion(BYTE* pbyteSrcImg, int nWidth, int nHeight, KeyPoints keyPoint,
		BYTE * pbyteAlignedImg, int nDstImgWidth, int nDstImgHeight);
	int Convert2Stride(int nWidth);
	double PointDistance(POINT p1, POINT p2);
	void CropImage( BYTE* all, int iWidth, int iHeight, BYTE* part, RECT rcRect );
	BOOL CropSubImage(BYTE * pbyteSrcImgData, int nSrcImgWidth, int nSrcImgHeight, BYTE * pDstImgData, RECT subRect);
	BOOL ResizeImage(const BYTE * pSrcImg, int nSrcWidth, int nSrcHeight, BYTE * pDstImg, int nDstWidth, int nDstHeight);
    BOOL ResizeImage_Eye(const BYTE * pSrcImg, int nSrcWidth, int nSrcHeight, BYTE * pDstImg, int nDstWidth, int nDstHeight);

	void SaveBmpFile(CString szFileName, BYTE * srcImage, int Width, int Height);
};
